// components/home/li/li.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    listData: '',
    type: 0, // 类型
    backlog: '', // 是否是待办
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    goDetail(e) {
      // if (!e.currentTarget.dataset.isexaminer) {
      //   wx.showToast({
      //     icon:'error',
      //     title: '没有权限查看',
      //   })
      //   return;
      // }
      if (!this.data.backlog) {
        if (e.currentTarget.dataset.pagejumptype === '发票') {
          wx.navigateTo({
            url: '/pages/invoicedetails/invoicedetails?id=' + e.currentTarget.dataset.id,
          })
        }
        if (e.currentTarget.dataset.pagejumptype === '到款认领') {
          if (e.currentTarget.dataset.editable) {
            if (e.currentTarget.dataset.status == 1) {
              wx.navigateTo({
                url: '/pages/receive/claim/claim?claimId=' + e.currentTarget.dataset.id,
              })
              return;
            }
            if (e.currentTarget.dataset.status == 3) {
              wx.navigateTo({
                url: '/pages/receive/returnedClaim/returnedClaim?claimId=' + e.currentTarget.dataset.id,
              })
              return;
            }
          }
          wx.navigateTo({
            url: '/pages/receive/details/details?claimId=' + e.currentTarget.dataset.id,
          })
        }
        if (e.currentTarget.dataset.pagejumptype === '到款认领作废') {
          wx.navigateTo({
            url: '/pages/receive/invalidDetails/invalidDetails?abolishId=' + e.currentTarget.dataset.id,
          })
        }
        if (e.currentTarget.dataset.pagejumptype === '发票作废') {
          wx.navigateTo({
            url: '/pages/voidDetails/voidDetails?id=' + e.currentTarget.dataset.id,
          })
        }
        if (e.currentTarget.dataset.pagejumptype === '汇票付款') {
          wx.navigateTo({
            url: '/pages/draftFkDetails/draftFkDetails?id=' + e.currentTarget.dataset.id,
          })
        }

        // if (e.currentTarget.dataset.isinvoice) {
        //   if (e.currentTarget.dataset.isabolish) {
        //     wx.navigateTo({
        //       url: '/pages/voidDetails/voidDetails?id=' + e.currentTarget.dataset.id,
        //     })
        //   } else {
        //     wx.navigateTo({
        //       url: '/pages/invoicedetails/invoicedetails?id=' + e.currentTarget.dataset.id,
        //     })
        //   }
        // } else {
        //   if (e.currentTarget.dataset.isabolish) {
        //     wx.navigateTo({
        //       url: '/pages/receive/invalidDetails/invalidDetails?abolishId=' + e.currentTarget.dataset.id,
        //     })
        //   } else {
        //     if (e.currentTarget.dataset.editable) {
        //       if (e.currentTarget.dataset.status == 1) {
        //         wx.navigateTo({
        //           url: '/pages/receive/claim/claim?claimId=' + e.currentTarget.dataset.id,
        //         })
        //         return;
        //       }
        //       if (e.currentTarget.dataset.status == 3) {
        //         wx.navigateTo({
        //           url: '/pages/receive/returnedClaim/returnedClaim?claimId=' + e.currentTarget.dataset.id,
        //         })
        //         return;
        //       } 
        //     }
        //     wx.navigateTo({
        //       url: '/pages/receive/details/details?claimId=' + e.currentTarget.dataset.id,
        //     })
        //   }

        // }
      }

    }
  }
})